package sz.szsmk.citizencard.ui.dzsmkavtivity;


import android.text.TextUtils;
import android.view.View;
import android.webkit.WebSettings;

import com.chenenyu.router.Router;
import com.chenenyu.router.annotation.Route;

import sz.szsmk.citizencard.R;
import sz.szsmk.citizencard.databinding.ActivitySignUpElectronCardBinding;
import sz.szsmk.citizencard.databinding.ActivityWordShowBinding;
import sz.szsmk.citizencard.mvp.presenter.IBasePresenter;
import sz.szsmk.citizencard.ui.base.IBaseActivity;

/**
 * Copyright (c)2018
 * author: zhf
 * created on: 2018/9/6 19:57
 * description:
 */
@Route("wordshow")
public class WordShowActivity extends IBaseActivity<IBasePresenter, ActivityWordShowBinding> {

    private String wordName = "";

    @Override
    protected int attachLayoutRes() {
        return R.layout.activity_word_show;
    }

    @Override
    protected void initInjector() {

    }

    @Override
    protected void initViews() {
        wordName = getIntent().getStringExtra("word_name");
        if (TextUtils.isEmpty(wordName))
            return;

        if (wordName.equals("nanjing_auth")) {
            dataBinding.settingTitle.setText("南京银行个人信息查询使用授权书");
        } else if (wordName.equals("nanjing_argeement")) {
            dataBinding.settingTitle.setText("南京银行电子账户服务协议");
        }else{
            dataBinding.settingTitle.setText("中国建设银行个人专用账户用户协议");
        }
        WebSettings webSettings = dataBinding.wordShow.getSettings();
        webSettings.setLoadWithOverviewMode(true);
        webSettings.setSupportZoom(true);
        webSettings.setBuiltInZoomControls(true);
        dataBinding.wordShow.loadUrl("file:///android_asset/" + wordName + ".html");

        dataBinding.back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
    }

    @Override
    protected void updateViews() {

    }
}
